<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="sm">
        播放列表...
        <div class="xm" style="display: none;">
            <div>歌名1</div>
            <div>歌名2</div>
            <div>歌名3</div>
            <div>歌名4</div>
            <div>歌名5</div>
            <div>歌名6</div>
        </div>
    </div>
</body>
</html>
<style>
    .sm{
        width: 200px;
        height: 30px;
        background-color: skyblue;
        margin: 0 auto;
    }
    .xm{
        width: 200px;
        height: 200px;
        background-color: steelblue;
    }
    div{
        height: 30px;
        background-color: slateblue;
        margin-top: 1px;
        line-height: 30px;
    }
</style>
<script>
    var sm=document.querySelector(".sm")
    var xm=document.querySelector(".xm")
    var index=1
    sm.onclick=function(){
       if (index==1) {
        xm.style.display="block"
        index=0
       }else{
        xm.style.display="none"
        index=1
       }
    }
    
</script>